﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using AutoMapper;

using Happy.AutoMapper;
using Happy.Cms.Domain.Articles;
using Happy.Cms.Query.Articles;
using Happy.Cms.Application.Shares;

namespace Happy.Cms.Application.Articles.Mappers
{
    public sealed class ArticleViewProfie : Profile<ArticleView, Article>
    {
        protected override void Configure(IMappingExpression<ArticleView, Article> map)
        {
            base.Configure(map);

            map.AfterMap((x, y) =>
            {
                x.UpdateSeoInfo(y.SeoInfo);
                x.UpdateImageInfo(y.ImageInfo);

                y.SettingInfo.Published = x.SettingInfo_Published;
                y.SettingInfo.ShowInTop = x.SettingInfo_ShowInTop;
            });
        }
    }
}
